import Layout from "./pages/Layout";
import Login from "./pages/Login";
import { Router, Route, Switch, Redirect } from 'react-router-dom'
import AuthRoute from "components/AuthRoute";
import history from "utils/history";

function App() {
  return (
    <Router history={history}>
      <div className="App">
        {/* 配置路由规则 */}
        <Switch>
          <Redirect exact from='/' to='/home'></Redirect>
          <Route path='/login' component={Login}></Route>
          {/* <Route path='/home' component={Layout}></Route> */}
          <AuthRoute path="/home" component={Layout}></AuthRoute>
        </Switch>
      </div>
    </Router>
  );
}

export default App;
